package com.evon.yardmanagement.model;

import java.io.Serializable;

import javax.persistence.AttributeOverride;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
@Entity
@Table(name ="PARKING_SLOT")
@AttributeOverride( name="id", column = @Column(name="SLOT_ID") )
public class ParkingSlot extends BaseModel implements Serializable{

	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	

	
	@Column(name="SLOT_NUMBER")
	private int number;
	
	@Column(name="SLOT_NAME")
	private String name;
	
	@Column(name="PRIORITY")
	private int priority;
	
	@Column(name="OCCUPIED")
	private int occupied;
	
	@Column(name = "ACTIVE")
	private int active;
	
	@ManyToOne
	@JoinColumn(name="SECTION_ID")
	private Section section;
	

	public Section getSection() {
		return section;
	}

	public void setSection(Section section) {
		this.section = section;
	}


	public int getNumber() {
		return number;
	}

	public void setNumber(int number) {
		this.number = number;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getPriority() {
		return priority;
	}

	public void setPriority(int priority) {
		this.priority = priority;
	}

	public boolean isOccupied() {
		if(occupied == 1){
			return true;
		}
		return false;
	}

	public int getOccupied() {
		return occupied;
	}
	
	public void setOccupied(int occupied) {
		this.occupied = occupied;
	}

	public int getActive() {
		return active;
	}

	public boolean isActive() {
		if(active ==0 )
			return false;
		return true;
	}

	
	public void setActive(int active) {
		this.active = active;
	}
	
	
		
}
